<?php
/*
 * @Author: lokei
 * @Date: 2022-09-28 20:55:13
 * @LastEditors: lokei
 * @LastEditTime: 2022-12-05 09:02:23
 * @Description: 
 */
$router->group(['prefix' => env('ROUTER_PREFIX') . 'api'], function () use ($router) {
	
	/** 表单 */
	$router->group(['prefix' => 'form', 'middleware' => 'auth'], function () use ($router) {
		$router->post('submit', [
			'as' => 'submit', 'uses' => '\App\Http\Controllers\Cms\Form\FormController@submit'
		]);
	});
	$router->group(['prefix' => 'form/record'], function () use ($router) {
		$router->get('list', [
			'as' => 'recordList', 'uses' => '\App\Http\Controllers\Cms\Form\RecordController@list'
		]);
		$router->get('get', [
			'as' => 'getRecord', 'uses' => '\App\Http\Controllers\Cms\Form\RecordController@get'
		]);
		$router->post('delete', [
			'as' => 'deleteRecord', 'uses' => '\App\Http\Controllers\Cms\Form\RecordController@delete'
		]);
	});
	// 选项
	$router->group(['prefix' => 'form/item'], function () use ($router) {
		$router->get('list', [
			'as' => 'list', 'uses' => '\App\Http\Controllers\Cms\Form\ItemController@list'
		]);
		$router->post('create', [
			'as' => 'create', 'uses' => '\App\Http\Controllers\Cms\Form\ItemController@create'
		]);
		$router->post('update', [
			'as' => 'update', 'uses' => '\App\Http\Controllers\Cms\Form\ItemController@update'
		]);
		$router->post('delete', [
			'as' => 'delete', 'uses' => '\App\Http\Controllers\Cms\Form\ItemController@delete'
		]);
    });

	
	/** 公告 */
	$router->group(['prefix' => 'notice'], function () use ($router) {
		// notice
		$router->get('get', [
			'as' => 'getNotice', 'uses' => '\App\Http\Controllers\Cms\Notice\NoticeController@get'
		]);
		$router->get('list', [
			'as' => 'NoticeList', 'uses' => '\App\Http\Controllers\Cms\Notice\NoticeController@list'
		]);
		$router->get('ofStore', [
			'as' => 'getNoticeOfStore', 'uses' => '\App\Http\Controllers\Cms\Notice\NoticeController@ofStore'
		]);
		$router->post('update', [
			'as' => 'updateNotice', 'uses' => '\App\Http\Controllers\Cms\Notice\NoticeController@update'
		]);
		$router->post('create', [
			'as' => 'createNotice', 'uses' => '\App\Http\Controllers\Cms\Notice\NoticeController@create'
		]);
		$router->post('delete', [
			'as' => 'deleteNotice', 'uses' => '\App\Http\Controllers\Cms\Notice\NoticeController@delete'
		]);
	});

	/** 文章 */
	$router->group(['prefix' => 'article'], function () use ($router) {
		// article
		$router->get('get', [
			'as' => 'getArticle', 'uses' => '\App\Http\Controllers\Cms\Article\ArticleController@get'
		]);
		$router->get('list', [
			'as' => 'ArticleList', 'uses' => '\App\Http\Controllers\Cms\Article\ArticleController@list'
		]);
		$router->post('update', [
			'as' => 'updateArticle', 'uses' => '\App\Http\Controllers\Cms\Article\ArticleController@update'
		]);
		$router->post('create', [
			'as' => 'createArticle', 'uses' => '\App\Http\Controllers\Cms\Article\ArticleController@create'
		]);
		$router->post('delete', [
			'as' => 'deleteArticle', 'uses' => '\App\Http\Controllers\Cms\Article\ArticleController@delete'
		]);
	});
	$router->group(['prefix' => 'article/recommend'], function () use ($router) {
		// article
		$router->get('get', [
			'as' => 'getRecommendArticle', 'uses' => '\App\Http\Controllers\Cms\Article\RecommendController@get'
		]);
		$router->post('set', [
			'as' => 'setRecommendArticle', 'uses' => '\App\Http\Controllers\Cms\Article\RecommendController@set'
		]);
	});
	
	/** 二维码 */
	$router->group(['prefix' => 'qrcode'], function () use ($router) {
		// Qrcode
		$router->get('get', [
			'as' => 'getQrcode', 'uses' => '\App\Http\Controllers\Cms\Qrcode\QrcodeController@get'
		]);
		$router->get('list', [
			'as' => 'qrcodeList', 'uses' => '\App\Http\Controllers\Cms\Qrcode\QrcodeController@list'
		]);
		$router->post('getOrCreate', [
			'as' => 'getOrCreateQrcode', 'uses' => '\App\Http\Controllers\Cms\Qrcode\QrcodeController@getOrCreate'
		]);
		$router->post('create', [
			'as' => 'createQrcode', 'uses' => '\App\Http\Controllers\Cms\Qrcode\QrcodeController@create'
		]);
		$router->post('delete', [
			'as' => 'deleteQrcode', 'uses' => '\App\Http\Controllers\Cms\Qrcode\QrcodeController@delete'
		]);
	});
	$router->group(['prefix' => 'qrcode', 'middleware' => 'auth'], function () use ($router) {
		// Qrcode
		$router->post('getOrCreateOfMe', [
			'as' => 'getOrCreateQrcode', 'uses' => '\App\Http\Controllers\Cms\Qrcode\QrcodeController@getOrCreateOfMe'
		]);
	});

	
	// 海报
	$router->group(['prefix' => 'poster'], function () use ($router) {
		// 海报
		$router->get('list', [
			'as' => 'posterList', 'uses' => '\App\Http\Controllers\Cms\Poster\PosterController@list'
		]);
		$router->get('get', [
			'as' => 'getPoster', 'uses' => '\App\Http\Controllers\Cms\Poster\PosterController@get'
		]);
		$router->get('ofType', [
			'as' => 'ofTypePoster', 'uses' => '\App\Http\Controllers\Cms\Poster\PosterController@ofType'
		]);
		$router->post('create', [
			'as' => 'createPoster', 'uses' => '\App\Http\Controllers\Cms\Poster\PosterController@create'
		]);
		$router->post('update', [
			'as' => 'updatePoster', 'uses' => '\App\Http\Controllers\Cms\Poster\PosterController@update'
		]);
		$router->post('delete', [
			'as' => 'deletePoster', 'uses' => '\App\Http\Controllers\Cms\Poster\PosterController@delete'
		]);
		
	});
	
	// 评价
	$router->group(['prefix' => 'comment', 'middleware' => 'auth'], function () use ($router) {
		// Comment
		$router->post('submit', [
			'as' => 'submitComment', 'uses' => '\App\Http\Controllers\Cms\Comment\CommentController@submit'
		]);
	});
	$router->group(['prefix' => 'comment'], function () use ($router) {
		// Comment
		$router->get('ofOrder', [
			'as' => 'commentOfOrder', 'uses' => '\App\Http\Controllers\Cms\Comment\CommentController@ofOrder'
		]);
		$router->get('ofGoods', [
			'as' => 'commentOfGoods', 'uses' => '\App\Http\Controllers\Cms\Comment\CommentController@ofGoods'
		]);
		$router->get('ofTopic', [
			'as' => 'commentOfTopic', 'uses' => '\App\Http\Controllers\Cms\Comment\CommentController@ofTopic'
		]);
		
		$router->post('delete', [
			'as' => 'commentDelete', 'uses' => '\App\Http\Controllers\Cms\Comment\CommentController@delete'
		]);
	});
});
